﻿using Demo.WebApi.Models.Products;
using Demo.WebApi.Repository;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;

namespace Demo.WebApi.Services
{
    [Dependency(ServiceLifetime.Singleton)]

    public class ProductService : IProductService
    {
        public IProductRepository  productRepository { get; set; }
        public void AddProduct(Product product)
        {           
            productRepository.Insert(product);
        }

        public void DeletedProduct(Product product)
        {
             productRepository.Delete(product);
        }

        public List<Product> SelectdProduct(Product product)
        {
            return productRepository.Select(product);
        }

        public void UpdatedProduct(Product product)
        {
           productRepository.Update(product);
        }
    }
}
